﻿using DotNetty.Transport.Channels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StickyBagServer
{
    public class StickyServerHandler : SimpleChannelInboundHandler<string>
    {
        private int count;

        protected override void ChannelRead0(IChannelHandlerContext ctx, string msg)
        {
            Console.WriteLine(msg);
            // 结果打印出来只有3,客户端100条数据被粘包成3条数据发送到服务器端
            Console.WriteLine(++count);
        }
    }
}
